<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="../css/1.css">
    <script src="../js/jquery-3.6.0.min.js"></script>
    <link rel="stylesheet" href="../css/table.css">

</head>
<body background="../img/123.jpg">
<div>
<div>
<form action="" method="post" class="dark-matter" >
    <h1 >Desert
        <span>Desert计算</span>
    </h1>
    <label>
        <span>全年目标业绩 :</span>
        <input id="performance" type="text" name="name" placeholder="请填写数字" />
    </label>
    <label>
        <span>每个月期望成交客户数量:</span>
        <input id="client" type="text" name="name" placeholder="请填写数字" />
    </label>
    <label>
        <span>你每月订阅费用是多少 :</span>
        <input id="subscription" type="text" name="name" placeholder="请填写数字" />
    </label>
    <label>
        <span>你的潜在客户和成交比 :</span>
        <input id="Proportion" type="text" name="name" placeholder="xx:xx" />
    </label>
    <label>
        <span>你的询盘客户是 :</span>
        <input id="inquiry" type="email" name="email" placeholder="(xx%)" />
    </label>
    <label>
        <span>外拓客户的比例 :</span>
        <input id="outreach" type="email" name="email" placeholder="(xx%)" />
    </label>
    <label>
        <span>你的询盘客户的转换率是 :</span>
        <input id="convert" type="email" name="email" placeholder="请填写数字" /><text style="color: red;font-size: 25px" title="转化率：就是来你网站询盘的客户转化成潜在客户（SQLs）的比率（并非是成交率）"> !</text>
    </label>
    <label>
        <span>你给你SDR每个月期获取多少个SQLs :</span>
        <input id="SDR" type="email" name="email" placeholder="请填写数字" />
    </label>
    <label>
        <span>你给你AE每个月期望成交多少个客户 :</span>
        <input id="AE" type="email" name="email" placeholder="请填写数字" />
    </label>
    <label>
        <span>&nbsp;</span>
        <input type="button" class="button" value="计算" onclick="calculate()" />
    </label>
</form>

</div >
    <div>
    <table class="altrowstable" id="alternatecolor" align="center">
        <tr>
            <th>你的MRR目标</th>
            <td id="MRR"></td>
        </tr>
        </tr>
        <tr>
            <th>你需要有多少笔交易</th>
            <td id="trade"></td>
        </tr>
        <tr>
            <th>你需要获取多个潜在客户才能达到目的</th>
            <td id="purpose"></td>
        </tr>
        <tr>
            <th>预期的询盘SQL数量/要多少个</th>
            <td id="SQL"></td>
        </tr>
        <tr>
            <th>营销部门需要生产多少个MQLs</th>
            <td id="MQLs"></td>
        </tr>
        <tr>
            <th>销售团队需要拓展多少个SQLs</th>
            <td id="SQLs"></td>
        </tr>
        <tr>
            <th>你需要的SDR人数</th>
            <td id="SdrPeople"></td>
        </tr>
        <tr>
            <th>你需要的AE人数</th>
            <td id="AePeople"></td>
        </tr>
    </table>
</div>
</div>
</body>
<script type="text/javascript">
    function altRows(id){
        if(document.getElementsByTagName){

            var table = document.getElementById(id);
            var rows = table.getElementsByTagName("tr");

            for(i = 0; i < rows.length; i++){
                if(i % 2 == 0){
                    rows[i].className = "evenrowcolor";
                }else{
                    rows[i].className = "oddrowcolor";
                }
            }
        }
    }

    window.onload=function(){
        altRows('alternatecolor');
    }

    function calculate(){
        performance =$('#performance').val()
        client =$('#client').val()
        subscription =$('#subscription').val()
        Proportion =$('#Proportion').val()
        inquiry =$('#inquiry').val()
        outreach =$('#outreach').val()
        convert =$('#convert').val()
        SDR =$('#SDR').val()
        AE =$('#AE').val()



        MRR=performance/(78*client)
        console.log(MRR)
        $("#MRR").html(MRR)
        trade=MRR/subscription
        console.log(trade)
        $("#trade").html(trade)
        purpose = Proportion.split(":")[1]*trade
        console.log(purpose)
        $("#purpose").html(purpose)
        SQL = inquiry*purpose
        console.log(SQL)
        $("#SQL").html(SQL)
        MQLs = SQL/convert
        console.log(MQLs)
        $("#MQLs").html(MQLs)
        SQLs = purpose*outreach
        console.log(SQLs)
        $("#SQLs").html(SQLs)
        SdrPeople = SQLs/SDR
        console.log(SdrPeople)
        $("#SdrPeople").html(SdrPeople)
        AePeople = trade/AE
        console.log(AePeople)
        $("#AePeople").html(AePeople)

    }


</script>
</html>